package com.zcp.proxydemo;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * Created by Administrator on 2017/3/15.
 */

public class OperateInvoke implements InvocationHandler {


    //创建委托类对象
    OperateImpl operate;

    //构造方法
    public OperateInvoke(OperateImpl operate) {
        this.operate = operate;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        Object o = method.invoke(operate, args);
        return o;
    }
}
